package com.slipper.system.log.controller;

import com.slipper.util.Tool;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.slipper.system.log.bo.OperatorLogBO;
import com.slipper.system.log.service.OperatorLogService;
import com.slipper.util.ResultUtil;

/**
 * 操作日志表
 */
@RestController
@RequestMapping("/system/operatorLog")
public class OperatorLogController {
    @Resource
    private OperatorLogService operatorLogService;
    
    @PostMapping(value = "/queryBy")
    public String queryBy(@RequestBody OperatorLogBO bo) {
        if(Tool.isBlank(bo.getId())) {
            return ResultUtil.failureResult("数据获取失败！");
        }
        return ResultUtil.successResult(operatorLogService.queryBy(bo.getId()));
    }
    
    @PostMapping(value = "/queryPage")
    public String queryPage(@RequestBody OperatorLogBO bo) {
        return ResultUtil.successResult(operatorLogService.queryPage(bo));
    }

    @PostMapping(value = "/save")
    public String save(@RequestBody OperatorLogBO bo) {
        return ResultUtil.saveResult(operatorLogService.save(bo));
    }

    @PostMapping(value = "/delete")
    public String delete(@RequestBody OperatorLogBO bo) {
        return ResultUtil.deleteResult(operatorLogService.delete(bo));
    }
}
